package com.xzq.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;

import com.xzq.biz.AddressBiz;
import com.xzq.entity.Address;
import com.xzq.entity.User;

@Controller
public class AddressAction extends BaseAction {
	@Resource
	private AddressBiz biz;
	private Address address;
	public Address getAddress() {
		return address;
	}
	public void setAddress(Address address) {
		this.address = address;
	}
	
	public String addAddress(){
		User u = (User) session.get("user");
		address.setUser(u);
		int count = biz.addAddress(address);
		if(count>=1){
			return "index";
		}else{
			return "fail";
		}
	}
}
